Simple LR ( k ) Grammars Franklin

نویسندگان

  • D. Gries
  • Franklin L. DeRemer
چکیده

A class of context-free grammars, called the "Simple LR(k)" or SLR(k) grammars is defined. This class has been shown to include weak precedence and simple precedence grammars as proper subsets. How to construct parsers for the SLR(k) grammars is also shown. These parser-construction techniques are extendible to cover all of the LR(k) grammars of Knuth; they have been implemented and by direct comparison proved to be superior to precedence techniques, not only in the range of grammars covered, but also in the speed of parser construction and in the size and speed of the resulting parsers.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Ch(k) Grammars: A Characterization of LL(k) Languages

From the point of view of parsing the LL(K] grammars constitute a very attractive class of context-free grammars. For each LL{K] grammar a top-down parsing algorithm can be devised which is essentially a one-state deterministic push-down automaton. From a more theoretiG point of view LL[K) grammars are attractive as well. It is well-known, for example, that it is decidable whether two LLfk) gra...

متن کامل

Simple Chain Grammars

A subclass of the LR(0)-grammars, the class of simple chain grammars is introduced. Although there exist simple chain gr~ars which are not LL(k) for any k, this new class of grammars is very close related to the class of LL(1) and simple LL(1) grammars. In fact it can be proved (not in this paper) that each simple chain grammar has an equivalent simple LL(1) grammar. A very simple (bottom-up) p...

متن کامل

On the Translation of Languages from Left to Right

There has been much recent interest in languages whose grammar is sufficiently simple that an efficient left-to-right parsing algorithm can be mechanically produced from the grammar. In this paper, we define LR(k) grammars, which are perhaps the most general ones of this type, and they provide the basis for understanding all of the special tricks which have been used in the construction of pars...

متن کامل

Cleaned SLL(1) Grammars are SLR(1)

We establish the following specific relation between contextfree grammars that have LL(k) and LR(k) parsers, respectively: after cleaning an SLL(1) grammar (by unfolding its empty productions), the resulting grammar is SLR(1).

متن کامل

On K(o) Grammars and Languages

Several definitions of the U(R) grammars can be found in the literature. Since the left-corner grammars can be defined as a restricted class of LR( k) grammars, there are also several definitions of the LC( k) grammars. Two such definitions are compared. For the case k = 0, these definitions are not equivalent. A characterization of the K(O) languages is given in terms of the simple determinist...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2000